//
//  WithdrawTableViewCell.m
//  ECO
//
//  Created by zl on 2019/10/12.
//  Copyright © 2019 谷银行. All rights reserved.
//

#import "WithdrawTableViewCell.h"

@implementation WithdrawTableViewCell
- (UILabel *)TimeTitle{
    if (!_TimeTitle) {
        _TimeTitle = [[UILabel alloc]init];
        _TimeTitle.font = [UIFont systemFontOfSize:15];
    }
    return _TimeTitle;
}
- (UILabel *)YearTitle{
    if (!_YearTitle) {
        _YearTitle = [[UILabel alloc]init];
        _YearTitle.font = [UIFont systemFontOfSize:10];
        _YearTitle.textColor = [UIColor colorWithHexString:@"#999999"];
    }
    return _YearTitle;
}
- (UIView *)BackView{
    if (!_BackView) {
        _BackView = [[UIView alloc]init];
        _BackView.backgroundColor = [UIColor colorWithHexString:@"#F9F9F9"];
    }
    return _BackView;
}
- (UILabel *)Title{
    if (!_Title) {
        _Title = [[UILabel alloc]init];
    }
    return _Title;
}
-(UILabel *)Status{
    if (!_Status) {
        _Status = [[UILabel alloc]init];
    }
    return _Status;
}
- (UILabel *)Time{
    if (!_Time) {
        _Time = [[UILabel alloc]init];
        _Time.font = [UIFont systemFontOfSize:12];
        _Time.textColor = [UIColor colorWithHexString:@"#999999"];
    }
    return _Time;
}
- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = [UIColor colorWithHexString:@"#E8E8E8"];
    }
    return _lineView;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.TimeTitle];
        [self.contentView addSubview:self.YearTitle];
        [self.contentView addSubview:self.BackView];
        [self.BackView addSubview:self.Title];
        [self.BackView addSubview:self.Status];
        [self.BackView addSubview:self.Time];
        [self.contentView addSubview:self.lineView];
        [self CellFrame];
        
    }
    return self;
}
- (void)CellFrame{
    // 那一天
    [_TimeTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(10);
        make.left.equalTo(self.contentView).offset(15);
        make.width.equalTo(@(43));
        make.height.equalTo(@(18));
    }];
    // 年
    [_YearTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.TimeTitle.mas_bottom).offset(5);
        make.left.equalTo(self.contentView).offset(17);
        make.width.equalTo(@(40));
        make.height.equalTo(@(14));
    }];
    // view
    [_BackView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(10);
        make.left.equalTo(self.TimeTitle.mas_right).offset(12);
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.height.equalTo(@(77));
    }];
    // view 里 标题
    [_Title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.BackView).offset(12);
        make.left.equalTo(self.BackView).offset(13);
        make.height.equalTo(@(22));
    }];
    //  状态
    [_Status mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.BackView.mas_bottom).offset(-10);
        make.left.equalTo(self.BackView).offset(14);
        make.height.equalTo(@(17));
    }];
    // view 里 时间
    [_Time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.BackView).offset(15);
        make.right.equalTo(self.BackView.mas_right).offset(-12);
        make.height.equalTo(@(17));
    }];
    // 虚线
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.YearTitle.mas_bottom).offset(5);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-2);
        make.left.equalTo(self.contentView).offset(30);
        make.width.equalTo(@(1));
    }];
    
}

@end
